 

import request from '@/router/axios'

export function fetchList(query) {
  return request({
    url: '/subwayst/swtkofficialticket/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/subwayst/swtkofficialticket',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/subwayst/swtkofficialticket/' + id,
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: '/subwayst/swtkofficialticket/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/subwayst/swtkofficialticket',
    method: 'put',
    data: obj
  })
}

export function delsObj(id) {
  return request({
    url: '/subwayst/swtkofficialticket/removeByIds',
    method: 'delete',
    data:id
  })
}

export function exportExcel(query) {
  return request({
    url: '/subwayst/swtkofficialticket/export',
    method: 'get',
    params: query,
    responseType: 'arraybuffer'
  })
}

export function saveBatch(body) {
  return request({
    url: '/subwayst/swtkofficialticket/saveBatch',
    headers: {"Content-Type": "multipart/form-data"},
    method: 'post',
    data: body
  })
}

//导出
export function dataExport(query) {
  return request({
    url: '/subwayst/swtkofficialticket/export',
    method: 'get',
    responseType: 'blob',
    params: query
  })
}

/**
 * 模板下载
 */
export function templateDowload(query) {
  return request({
    url: "/subwayst/swtkofficialticket/exportTamplateOfficial",
    method: 'get',
    responseType: 'blob',
    params: query
  })
}